﻿using System.Text;

namespace Startup.Base.Utils
{
	public class TabStringBuilder
	{
		private readonly StringBuilder _builder = new StringBuilder();

		public TabStringBuilder Tab()
		{
			_builder.Append("\t");
			return this;
		}

		public TabStringBuilder AddLine(string line)
		{
			_builder.AppendLine(line);
			return this;
		}

		public TabStringBuilder AddLine()
		{
			return AddLine(string.Empty);
		}

		public TabStringBuilder AddLine(string format, params object[] args)
		{
			return AddLine(string.Format(format, args));
		}

		public TabStringBuilder AddText(string text)
		{
			_builder.Append(text);
			return this;
		}

		public TabStringBuilder AddText(string format, params object[] args)
		{
			return AddText(string.Format(format, args));
		}

		public override string ToString()
		{
			return _builder.ToString();
		}
	}
}
